class GeneradorxmlController < ApplicationController

  def generadorxml
    # @xml = Builder::XmlMarkup.new
    @id = params[:id]
    @orden_servicio = OrdenServicio.find(params[:id])
    unless @orden_servicio.estatus == "Recolectada"
      OrdenServicio.cambiar_estatus_recoleccion_xml(@orden_servicio.id)
    end
    @orden_servicio = OrdenServicio.find_by_sql("select o.traking as traking, o.fecha_orden as fecha_orden, o.id as id, o.estatus as estatus from orden_servicios o where o.estatus = 'Recolectada' AND o.id='"+@id.to_s+"'").first
    render :layout => false
  end
end
